import { ContentType } from '@/enums/httpEnum';
import { request } from '@umijs/max';

export async function speakOn(data: API.Home.Speak){
    return request<API.Home.Result>('/api/inspection/audio/start', {
        method: 'POST',
        data: data
    })
}
export async function speakOff(data: API.Home.Speak){
    return request<API.Home.Result>('/api/inspection/audio/stop', {
        method: 'POST',
        data: data
    })
}

export async function connect(ip:String) {
    return request<API.Home.Result>('/api/inspection/ws/connect', {
        method: 'POST',
        data:{
            "ip": ip,
            "topic": "",
            "data": {},
            "sportId": 0
        }
    });
}

export async function disconnect(ip:String) {
    return request<API.Home.Result>('/api/inspection/ws/disconnect', {
        method: 'POST',
        data:{
            "ip": ip,
        }
    });
}

export async function send(data: API.Home.Message) {
    return request<API.Home.Result>('/api/inspection/ws/send', {
        method: 'POST',
        data:data
    });
}